package com.atguigu.Util;

/**
 * @author hjy
 * @create 2023/3/12 18:34
 */
public class MySqlUtil {
    public static String getWithCon(String tableName) {
        return "with(\n" +
                "    'connector' ='jdbc',\n" +
                "    'username'='root',\n" +
                "    'password'='123456',\n" +
                "    'url'='jdbc:mysql://hadoop102:3306/gmall',\n" +
                "    'table-name'='" + tableName + "',\n" +
                "    'lookup.cache.max-rows' = '10',\n" +
                "    'lookup.cache.ttl' = '1 hour',\n" +
                "    'driver' = 'com.mysql.cj.jdbc.Driver'\n" +
                ")";
    }

    public static String getMysqlDDl() {
        return "create table base_dic(\n" +
                "    `dic_code` STRING,\n" +
                "    `dic_name` STRING,\n" +
                "    `parent_code` STRING,\n" +
                "    `create_time` STRING,\n" +
                "    `operate_time` STRING\n" +
                ")" + getWithCon("base_dic");
    }
}
